<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="../taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>课程科目管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="../css/four.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../css/jqe/themes/default/easyui.css"/>
	<link rel="stylesheet" type="text/css" href="../css/jqe/themes/icon.css"/>

    <script type="text/javascript" src="../js/jquery-3.1.1.min.js"></script>
	<script type="text/javascript" src="../js/jquery.easyui.min.js"></script>

    <script type="text/javascript">
    
 /*       var msg="${msg}";
       if(msg!=""){
    	   alert(msg);
       }
     */

        $(function(){
          
         	//初始化对话框
        	 $('#dw,#dwEdit').window({
       		   onBeforeClose:function(){ 
       			   //取消时关闭等待框
       			   setTimeout(function(){ 
       				   sending.style.visibility = "hidden";
					   }, 250);
       	    }});
       	
            $(".btnAll").each(function(i,v){
         	   //变手型
         	     $(v).mouseover(function() {
     				$(this).css("cursor", "hand");
     			 }).mouseout(function() {
     				$(this).css("cursor", "pointer");
     			 });
         	   
          	   if($(v).html()=='【新增】'){
          		   $(v).click(function(){
          			   $('#dw').window("open");
          		   });
          	   }else if($(v).html()=='【编辑】'){
        		   $(v).click(function(){  
        			   location.href="toUpdateSub.do?subid="+$(v).prop("lang");  
        		   });
        	   }else if($(v).html()=='【删除】'){
        		   $(v).click(function(){
         			  if(confirm("确认删除'"+$(v).prop("title")+"'?")){
         				  location.href="delSub.do?sbid="+$(v).prop("lang"); 
         			  }
         		   });
         	   }
         	   
            });
        	
            $("#sel_cms").change(function(){
            	
            	//alert($("#sel_cms").val());
                location.href="showSubject.do?kcmdelid="+$("#sel_cms").val();
            
            });
            
            
        });
    </script>
</head>
<body>
	<!-- 包含等待框 -->
	<jsp:include page="../waittable.jsp" flush="true" />
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr valign="top">
			<td bgcolor="#FFFFFF"><table width="96%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#aec3de">
					<tr align="left" bgcolor="#F2FDFF">
						<td colspan="8" class="optiontitle">
						 <select id="sel_cms" name="slkt_dps">
						    <option  value="0">全部</option>
						    <c:forEach items="${cms}" var="cm">
						       <option   ${page.params.kcmdelid==cm.kcmdelid?"selected='selected'":""} value="${cm.kcmdelid}">${cm.kcmdelName}</option>
						    </c:forEach>
						 </select>
						  课程科目列表</td>
					</tr>
				  	<tr align="center">
					    <td align="center" bgcolor="#ebf0f7">科目ID</td>
						<td align="center" bgcolor="#ebf0f7">科目名称</td>
						<td align="center" bgcolor="#ebf0f7">科目所属模块</td>
						<td align="center" bgcolor="#ebf0f7">科目标准天</td>
						<td align="center" bgcolor="#ebf0f7">科目内容</td>
						<td align="center" bgcolor="#ebf0f7">科目在课程中的序号</td>
						<td align="center" bgcolor="#ebf0f7">科目描述</td>
						<td align="center" bgcolor="#ebf0f7">操作 <span class="btnAll">【新增】</span> </td>
					</tr>
					<c:forEach items="${page.results}" var="sub">
						<tr align="center" bgcolor="#FFFFFF">
						    <td align="center" bgcolor="#ebf0f7">${sub.sbid}</td>
							<td align="center">${sub.sbname}</td>
							<td align="center">${sub.kcmdelName}</td>
							<td align="center">${sub.sbdays}</td>
							<td align="center">${sub.sbcontent}</td>
							<td align="center">${sub.sbno}</td>
							<td align="center">${sub.sbdescb}</td>
							<td align="center">
							【<a href="onesub.do?sbid=${sub.sbid}">查看</a>】<c:if test="${lgnUsr.eid > 0}">
									| <span class="btnAll" lang="${sub.sbid}">【编辑】</span>
								    | <span class="btnAll" lang="${sub.sbid}" title="${sub.sbname}">【删除】</span>
				                   </c:if>
							</td>
						</tr>
					</c:forEach>
					<tr align="right" bgcolor="#ebf0f7">
							<td colspan="8">
							<jk:page totalPage="${page.totalPage}" pageNo="${page.pageNo}" totalRecord="${page.totalRecord}"
                                url="showSubject.do?kcmdelid=${kcmdelid }" />
							</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
		  <td align="center" style="color: red">${msg}</td>
		</tr>
	</table>
  
	<div id="dw" class="easyui-window" title="创建新科目" data-options="modal:true,minimizable:false,closed:true,maximizable:false,iconCls:'icon-save'" style="width:300px;height:350px;padding:10px;display: none;">
		<form action="addSub.do" method="post">
		       科目名称：&nbsp&nbsp&nbsp<input name="sbname"/><br /><br />
		   科目所属模块：<select name="kcmdelid">
		   <c:forEach items="${cms }" var="cm">
		   <option value="${cm.kcmdelid }">${cm.kcmdelName }</option>
		   </c:forEach>
		   </select><br /><br />
		       科目标准天：<input name="sbdays"/><br /><br /> 
		       科目在课程中的序号：<input name="sbno" size="15"><br> 
		       科目内容<textarea name="sbcontent" rows="2" cols="30"></textarea><br>   
		       科目描述<textarea name="sbdescb" rows="3" cols="30"></textarea><br> <br> 
		      <input  type="submit" value="添加"/><br>
		</form>
	</div>
</body>
</html>